100 REM PLATOON FILE PROGRAM 105 : 110 DIM N$(200,27):NF=27:FF=0 115 : 120 REM NF-NUMBER OF FIELDS...N$ CONTAINS THE FILE 125 : 127 PRINT"[147]MENU[146]" 130 PRINT"1 CREATE THE FILE" 135 PRINT"2 UPDATE THE FILE[146]" 140 PRINT"3 REVIEW THE FILE[146]" 145 PRINT"4 SORT[146]" 150 PRINT"5 SAVE[146]" 155 PRINT"6 QUIT[146]" 160 : 165 INPUT"YOUR CHOICE PLEASE";YY 170 IFYY<> 1ANDFF=0 THEN GOSUB 5000 180 ONYY GOSUB 1000,2000,3000,4000,6000,7000 185 FF=1 190 GOTO120 195 END 200 : 1000 REM CREATE THE FILE 1005 : 1010 INPUT"HOW MANY FILES";N 1011 : 1015 FOR X=1TO N 1016 PRINT"[147]" 1020 FOR Y=1 TO NF 1025 READ A$ 1035 PRINTA$; 1040 INPUT N$(X,Y) 1045 NEXTY 1050 RESTORE 1055 NEXT X 1060 : 1065 PRINT"[147] PRESS PLAY/RECORD ON TAPE" 1075 PRINT"HIT 'C' TO CONTINUE" 1080 GET A$:IF A$=""THEN 1080 1085 PRINT"[147]QUIET[146] I'M SAVING" 1090 : 1095 REM SAVING ON TAPE 1100 OPEN1,1,1,"DATA FILE" 1105 PRINT#1,N 1110 FOR X=1 TO N 1115 FOR Y=1TO NF 1120 PRINT#1,N$(X,Y) 1125 NEXT Y 1130 NEXT X 1135 CLOSE1 1136 RETURN 1140 : 2000 REM UPDATE ROUTINE 2005 : 2010 PRINT"[147]UPDATE MENU" 2015 PRINT"1 ADD[146]" 2020 PRINT"2 DELETE[146]" 2025 PRINT"3 CHANGE[146]" 2030 : 2035 INPUT"YOUR CHOICE PLEASE";C 2040 ON C GOSUB 2500,2700,2300 2045 INPUT"[147]ANY MORE UPDATES (Y/N)";D$ 2050 IF D$="Y" THEN 2000 2055 RETURN 2300 REM CHANGE ROUTINE 2301 : 2305 INPUT"[147]BADGE # PLEASE";BN$ 2310 FOR X=1TON 2315 IF BN$=N$(X,3)THEN GOSUB 2400 2320 NEXT X 2325 : 2330 RETURN 2400 REM DISPLAY RECORD 2405 : 2406 PRINT"[147]HIT RETURN[146] FOR NO CHANGE" 2410 FOR Y=1 TO NF 2415 READ A$ 2420 PRINT"";A$;"[146]";TAB(20);N$(X,Y);" ";"/"; 2425 INPUT"[157][157][157]";B$ 2430 IF B$<>"/" THEN N$(X,Y)=B$ 2435 NEXT Y 2440 RESTORE 2445 RETURN 2450 : 2500 REM ADD SUBROUTINE 2505 : 2510 INPUT"[147]HOW MANY NEW RECORDS";NR 2512 PRINT"[147]" 2515 FOR X=N+1TON+NR 2520 FOR Y=1TONF 2525 READA$ 2530 PRINTA$;" "; 2535 INPUT N$(X,Y) 2540 NEXTY 2541 PRINT"[147]" 2545 RESTORE 2550 NEXTX 2553 N=N+NR 2555 RETURN 2560 : 2700 REM DELETIONS ROUTINE 2705 : 2710 INPUT"[147]BADGE NUMBER";BN$ 2715 X=1 2720 FOR I=1TO N 2725 FOR J=1TO NF 2730 IF BN$=N$(I,3) THEN I=I+1 2735 N$(X,J)=N$(I,J) 2740 NEXT J 2745 X=X+1 2750 NEXTI 2751 N=N-1 2755 RETURN 2760 : 3000 REM REVIEW ROUTINE 3005 : 3010 PRINT"[147]MENU" 3015 PRINT"1 REVIEW ENTIRE FILE" 3020 PRINT"2 REVIEW SINGLE RECORD" 3025 PRINT"3 REVIEW BY PLATOON" 3030 INPUT"YOUR CHOICE PLEASE[146]";R 3035 ON R GOSUB 3200,3500,3700 3040 INPUT"[147]ANY MORE REVIEWS";B$ 3045 IF B$="Y" THEN 3000 3050 RETURN 3055 : 3200 REM ENTIRE FILE REVIEW 3205 : 3207 XX$="[160]" 3208 INPUT"[147] DO YOU WISH A PRINTER COPY";XX$ 3209 IFXX$="Y" THEN OPEN4,4:PRINT#4," ":CLOSE4 3210 FOR X=1TO N 3215 PRINT"[147]" 3220 FOR Y=1TO NF 3225 READ A$ 3227 IFXX$="Y" THEN GOSUB 8000 3230 PRINT"";A$;"[146]";TAB(20); 3235 PRINTN$(X,Y) 3236 IF Y=13 THEN GOSUB3950 3240 NEXTY 3245 RESTORE 3250 PRINT"HIT C TO CONTINUE[146]" 3255 GETB$:IF B$="" THEN 3255 3260 NEXT X 3261 RETURN 3265 : 3500 REM REVIEW BY BADGE NUMBER 3505 : 3507 XX$="" 3508 INPUT"[147] DO YOU WISH A PRINTER COPY";XX$ 3509 IFXX$="Y" THEN OPEN4,4:PRINT#4," ":CLOSE4 3510 INPUT"[147]BADGE NUMBER PLEASE";BN$ 3512 FOR X=1TON 3513 PRINT"[147]" 3515 IF BN$<>N$(X,3) THEN 3580 3520 FOR Y=1TONF 3525 READA$ 3527 IF XX$="Y" THEN GOSUB 8000 3530 PRINT"";A$;"[146]";TAB(20); 3535 PRINTN$(X,Y) 3536 IF Y=13 THEN GOSUB3950 3540 NEXTY 3545 X=N:RESTORE 3580 NEXT X 3581 PRINT"HIT C TO CONTINUE" 3582 GET G$:IF G$=""THEN3582 3583 RETURN 3585 : 3636 IF Y=13 THEN GOSUB 3950 3700 REM PLATOON REVIEW 3705 : 3707 XX$=" " 3708 INPUT"[147] DO YOU WISH A PRINTER COPY";XX$ 3709 IFXX$="Y" THEN OPEN4,4:PRINT#4," ":CLOSE4 3710 INPUT"[147]ENTER PLATOON NUMBER PLEASE";PN$ 3715 FOR X=1TON 3716 PRINT"[147]" 3720 IF PN$<>N$(X,4) THEN 3780 3725 FOR Y=1TONF 3727 IFXX$="Y" THEN GOSUB 8000 3730 READ A$ 3735 PRINT"";A$;"[146]";TAB(20); 3740 PRINTN$(X,Y) 3741 IF Y=13 THEN GOSUB 3950 3745 NEXTY 3750 RESTORE 3751 GOSUB 3950 3780 NEXTX 3781 PRINT"HIT C TO CONTINUE" 3782 GETG$:IF G$="" THEN 3782 3785 RETURN 3790 : 3950 PRINT"HIT C TO CONTINUE" 3955 GETG$ 3960 IF G$="C" THEN PRINT"[147]" 3965 IF G$=""THEN 3955 3970 RETURN 4000 REM SORT ROUTINE 4005 : 4010 PRINT"[147]SORT MENU[146]" 4011 PRINT"REVIEW THE MENU AND PICK THE NUMBER OF THE FIELD YOU WISH TO BE SORTED" 4015 FOR Y=1TONF 4020 READA$ 4025 PRINTY,A$ 4026 IF Y=13 THEN GOSUB3950 4030 NEXT Y 4035 RESTORE 4040 INPUT"PICK A NUMBER[146]";SF 4045 PRINT"[147]SORTING" 4050 FOR U=1TON-1 4055 FLAG=0 4060 FOR V=1TON-U 4065 IF N$(V,SF)>N$(V+1,SF)THEN GOSUB 4500 4070 NEXTV 4075 IF FLAG =0 THEN U=N-1 4080 NEXTU 4085 RETURN 4090 : 4500 REM SWITCH ROUTINE 4505 : 4510 FOR T=1TO NF 4515 T$=N$(V,T) 4520 N$(V,T)=N$(V+1,T) 4525 N$(V+1,T)=T$ 4530 NEXT T 4535 FLAG =1 4540 RETURN 4545 : 5000 REM LOADING ROUTINE 5005 : 5010 PRINT"[147]PRESS PLAY ON TAPE" 5015 PRINT"HIT 'C' TO CONTINUE" 5020 GETA$: IF A$="" THEN 5020 5025 OPEN1,1,0,"DATA FILE" 5030 INPUT#1,N 5035 FOR X=1TO N 5040 FOR Y=1TO NF 5045 INPUT#1,N$(X,Y) 5050 NEXTY 5055 NEXTX 5060 CLOSE1 5061 RETURN 5065 : 6000 REM SAVING ROUTINE 6005 : 6010 PRINT"[147]REWIND TAPE AND PRESS PLAY/RECORD" 6015 OPEN1,1,1,"DATA FILE" 6020 PRINT#1,N 6025 FOR X=1TON 6030 FOR Y=1TO NF 6035 PRINT#1,N$(X,Y) 6040 NEXTY 6045 NEXTX 6050 CLOSE1 6055 RETURN 6060 : 7000 REM END ROUTINE 7005 : 7010 PRINT"[147][145][145][145][157][157][157]BYE FOR NOW MUFFIN[146]" 7015 END 7020 RETURN 8000 OPEN4,4 8005 PRINT#4,A$;CHR$(16);"40";N$(X,Y) 8010 CLOSE4 8015 RETURN 10000 DATA NAME,RANK,BADGE NUMBER,PLATOON,ADDRESS 1,ADDRESS 2,RES PHONE 10005 DATA BUS PHONE,DATE JOINED,DATE PROMOTED,B CARD (Y/N) 10010 DATA DATE OR ISSUE,DOC A POS,DOC B NEG,PROBATIONS,LOA 10015 DATA PERFORMANCE REVIEW,MEETINGS #P,MEETINGS #E,MEETINGS #A,TOTAL HOURS 10020 DATA CAR/BEAT Y/T/D HRS,SPECIALS #P,SPECIALS #E,SPECIALS #A,TOTAL HOURS 10025 DATA GRAND TOTAL Y/T/D